/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.example.demo.service;

import com.example.demo.entity.SysUser;
import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import com.github.pagehelper.PageHelper;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author danny
 */
@Service
public class UserService {
    
    @Autowired
    UserMapper userMapper;
    
    public User getUserById(int id) {
        return userMapper.selectOneById(id);
    }
    
    public List<SysUser> getAllSysUser() {
        PageHelper.startPage(1, 5);
        return userMapper.selectAll();
    }
    
}
